// 压型
<template>
  <div class="container card">
    <el-tabs v-model="formingactiveName" type="card" @tab-click="handleClick">
      <el-tab-pane label="筛分记录表" name="screening">
        <screeningRecord />
      </el-tab-pane>
      <el-tab-pane label="配料记录表" name="ingredients">
        <ingredientsRecord />
      </el-tab-pane>
      <el-tab-pane label="交接班表" name="handover">
        <handover />
      </el-tab-pane>
      <el-tab-pane label="产品信息" name="productInfo">
        <productInfo />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import ingredientsRecord from './ingredientsRecord'
import screeningRecord from './screeningRecord'
import productInfo from './productInfo'
import handover from './handover'
export default {
  name: '',
  components: {
    ingredientsRecord,
    screeningRecord,
    productInfo,
    handover
  },
  props: {},
  data () {
    return {
      formingactiveName: 'screening',
      screeningRecord: true,
      ingredientsRecord: false,
      productInfo: false,
      handover: false
    }
  },
  computed: {},
  watch: {},
  created () {
    if (sessionStorage.getItem('formingActiveName')) {
      this.formingactiveName = sessionStorage.getItem('formingActiveName')
      switch (sessionStorage.getItem('formingActiveName')) {
        case 'screening':
          this.screeningRecord = true
          this.ingredientsRecord = false
          this.productInfo = false
          this.handover = false
          break
        case 'ingredients':
          this.ingredients = true
          this.screeningRecord = false
          this.productInfo = false
          this.handover = false
          break
        case 'productInfo':
          this.ingredients = false
          this.screeningRecord = false
          this.productInfo = true
          this.handover = false
          break
        case 'handover':
          this.ingredients = false
          this.screeningRecord = false
          this.productInfo = false
          this.handover = true
          break
        default:
          console.log('找不到页面')
          break
      }
    }
  },
  beforeDestory () {
    sessionStorage.setItem('formingActiveName', 'screeningRecord')
  },
  mounted () { },
  methods: {}
}
</script>

<style scoped lang="">
</style>
